package IOStream.SerializationStream;

import java.io.FileInputStream;
import java.io.IOException;
import java.io.ObjectInputStream;
import java.util.ArrayList;

/**
 * ClassName:Text
 * Package:IOStream.SerializationStream
 * Description:
 *
 * @Author:ZhangXin
 * @Create2023/3/3-20:32
 * @Version:v1.0
 */
public class Text {
    public static void main(String[] args) throws IOException, ClassNotFoundException {
        //创建反序列化流的对象
        ObjectInputStream ois = new ObjectInputStream(new FileInputStream("E:\\aaa\\a.txt"));
        //读取数据
//        Student001 s1 = (Student001) ois.readObject();
//        Student001 s2 = (Student001) ois.readObject();
//        Student001 s3 = (Student001) ois.readObject();
        ArrayList<Student001> list = (ArrayList<Student001>) ois.readObject();
        for (Student001 student001 : list) {
            System.out.println(student001);
        }

//        System.out.println(s1);
//        System.out.println(s2);
//        System.out.println(s3);
        //释放资源
        ois.close();
    }
}
